package com.farm.facade;

// 外观类
public class AgriculturalSystemFacade {
    private MachineManagementSubsystem machineManagement;
    private EnvironmentMonitoringSubsystem environmentMonitoring;
    private PathPlanningSubsystem pathPlanning;

    public AgriculturalSystemFacade() {
        this.machineManagement = new MachineManagementSubsystem();
        this.environmentMonitoring = new EnvironmentMonitoringSubsystem();
        this.pathPlanning = new PathPlanningSubsystem();
    }

    public void startDailyOperation(String machineName) {
        System.out.println("=====" + machineName + "开始日常作业 =====");
        environmentMonitoring.checkEnvironment(machineName);
        machineManagement.checkMachineStatus(machineName);
        pathPlanning.planPaths(machineName);
        machineManagement.distributeTasks(machineName);
        System.out.println("===== " + machineName + "日常作业启动完成 =====");
    }

    public void emergencyStop() {
        System.out.println("===== 紧急停止所有农机 =====");
        System.out.println("发送停止信号到所有农机");
        System.out.println("保存当前作业状态");
        System.out.println("通知操作人员");
        System.out.println("===== 紧急停止完成 =====");
    }
}
